package com.zhengtoudai.ui.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.zhengtoudai.R;
import com.zhengtoudai.ui.bean.ShareRecordModel;
import com.zhengtoudai.view.recyclerview.RecyclerViewAdapter;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 我的邀请记录
 */

public class MyShareRecordAdapter extends RecyclerViewAdapter<MyShareRecordAdapter.ViewHolder, ShareRecordModel.ShareRecordBean.RecommedList> {
    @Override
    public ViewHolder mOnCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_share_record, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void mOnBindViewHolder(ViewHolder holder, int position) {
        holder.mTvAccount.setText(data.get(position).getUserAccount());
        holder.mTvDate.setText(data.get(position).getRecommendAddtime());
        holder.mTvMoney.setText(data.get(position).getRecommendMoney());
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
        @Bind(R.id.tv_account)
        TextView mTvAccount;
        @Bind(R.id.tv_date)
        TextView mTvDate;
        @Bind(R.id.tv_money)
        TextView mTvMoney;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
